package com.wsp.apimanagement.common.impl;

import com.wsp.apimanagement.common.CdnUtil;
import java.io.BufferedInputStream;
import java.util.concurrent.Callable;

/**
 * Package: com.wsp.apimanagement.common.impl
 * Description： TODO
 *
 * @Author: 巫思平
 * Copyright: Copyright (c) 2020
 * Version: 1
 */
public abstract class AbstratCdnUtilImpl implements CdnUtil, Callable<Boolean> {

    @Override
    public<T> String getToken(T args){
        return null;
    }

    @Override
    public String uploadBigCommonFile(String fileName, BufferedInputStream inputStream) {
        return CdnUtil.super.uploadBigCommonFile(fileName, inputStream);
    }

    /**
     *
     * @param fileName 文件名
     * @param inputStream 文件流
     * @return
     */
    @Override
    public String uploadCommonFile(String fileName, BufferedInputStream inputStream) {
        return "";
    }

    @Override
    public Boolean call() throws Exception {
        return null;
    }

    /**
     *  获取文件名
     * @return 文件名
     */
    public static String fileName() {
        return fileName(null);
    }
    public static String fileName(String count) {
        int v = (int) (Math.random() * 100000);
        return System.currentTimeMillis()+count+v;
    }

}
